package model;

public class PredicateInfo {
	private Integer id;
	private Integer domain_id;
	private Integer range_id;
	private Integer reverse_id;
	private boolean expects_cvt;
	private boolean is_functional;
	
	public PredicateInfo(Integer id, Integer domain_id, Integer range_id,
						 Integer reverse_id, boolean is_functional) {
		this.id = id;
		this.domain_id = domain_id;
		this.range_id = range_id;
		this.reverse_id = reverse_id;
		this.is_functional = is_functional;
		this.expects_cvt = false;
	}
	
	public Integer getId() { return id; }
	public Integer getDomainId() { return domain_id; }
	public Integer getRangeId() { return range_id; }
	public Integer getReverseId() { return reverse_id; }
	public boolean expectsCvt() { return expects_cvt; }
	public boolean isFunctional() { return is_functional; }
	
	public void setReverseId(Integer id) {
		reverse_id = id;
	}
	
	public void setExpectsCvt(boolean expects_cvt) {
		this.expects_cvt = expects_cvt;
	}

	public void setIsFunctional(boolean is_functional) {
		this.is_functional = is_functional;
	}
	
	public static boolean hasRawObjectColumn(TableInformation table_info, PredicateInfo pred_info) {
		String range_string = table_info.getStringForId(pred_info.range_id);
		if (range_string.startsWith("/type/"))
			return true;
		else
			return false;
	}
 }
